namespace Cos.Core.NHibernate
{
    using System;

    using Cos.Core.Model.Template;

    public class OptionCultureDataModel : DataModelBase<OptionCulture>
    {
        public OptionCultureDataModel() {}

        public virtual string CultureCode { get; set; }

        public virtual string DisplayName { get; set; }

        public virtual int Id { get; set; }

        public virtual int OptionId { get; set; }

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }

            var model = obj as OptionCultureDataModel;

            return model != null && this.Id == model.Id;
        }

        public override int GetHashCode()
        {
            return this.Id.GetHashCode();
        }

        public override void Fill(OptionCulture model)
        {
            throw new NotImplementedException();
        }

        public override OptionCulture ToModel()
        {
            var model = this.CreateModel();

            model.Id = this.Id;
            model.CultureCode = this.CultureCode;
            model.DisplayName = this.DisplayName;
            model.OptionId = this.OptionId;

            return model;
        }
    }
}